
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Fashion Girl</title>
        <link href="public/CSS/Style.css" rel="stylesheet" type="text/css" />
        <?php
        require_once 'model/db.php';
        require_once 'model/works.php';
        require_once 'template/pagination.php';
        $works = new works();
        $paginations = new pagination();
        ?>
    </head>
    <body style="background-color: #ffefe9;">
        <div class="chung">
            <?php include 'template/header.php'; ?>
            <div class="content">
                <?php
                        if (!isset($_GET["page"]))
                            $page = 1;
                        else
                            $page = $_GET["page"];
                        //$list = $works->selectW($page);
                        $result1 = $works->selectW1($page);
                        $result2 = $works->selectW2($page);
                        $result3 = $works->selectW3($page);
                        $result4 = $works->selectW4($page);
                        $total = $works->countW();
                        echo $paginations->display($page, $total, null, "product.php");
                        ?><br>
                <table border="0px" align="center">
                    <tr>
                        <td align="center">
                            <?php foreach ($result1 as $item1):?>
                            <a class="row" href="view.php?id=<?php echo $item1['id']?>">
                                <div></div><img src="<?php echo $item1['image']?>" width="220px" height="350px"  style="border: 2px solid #660000" ><br><br>
                            <?php echo $item1['name'];?><br>
                                <a style="color: #333333; text-decoration: none"><?php echo $item1['price'];?></a>
                            </a>
                            <?php endforeach;?>
                        </td>
                        <td align="center">
                            <?php foreach ($result2 as $item2):?>
                            <a class="row" href="view.php?id=<?php echo $item2['id']?>">
                                <img src="<?php echo $item2['image']?>" width="220px" height="350px" style="border: 2px solid #660000"><br><br>
                            <?php echo $item2['name'];?><br>
                            <a style="color: #333333; text-decoration: none"><?php echo $item2['price'];?></a>
                            </a>
                            <?php endforeach;?>
                        </td>
                        <td align="center">
                            <?php foreach ($result3 as $item3):?>
                            <a class="row" href="view.php?id=<?php echo $item3['id']?>">
                            <img src="<?php echo $item3['image']?>" width="220px" height="350px"  style="border: 2px solid #660000"><br><br>
                            <?php echo $item3['name'];?><br>
                            <a style="color: #333333; text-decoration: none"><?php echo $item3['price'];?></a>
                            </a>
                            <?php endforeach;?>
                        </td>
                        <td align="center">
                            <?php foreach ($result4 as $item4):?>
                            <a class="row" href="view.php?id=<?php echo $item4['id']?>">
                            <img src="<?php echo $item4['image']?>" width="220px" height="350px"  style="border: 2px solid #660000"><br><br>
                            <?php echo $item4['name'];?><br>
                            <a style="color: #333333; text-decoration: none "><?php echo $item4['price'];?></a>
                            </a>
                            <?php endforeach;?>
                        </td>
                        </tr>
                </table><br>
            </div>
            <?php include 'template/footer.php'; ?>
        </div>
    </body>
</html>

